package com.audi.utils;

import java.util.Comparator;

import com.audi.dto.DeviceItem;

public class ItemComparator {
    
    // Comparator Device Item By Device Id (ASC)
    public static Comparator<DeviceItem> ComparatorDeviceById = new Comparator<DeviceItem>() {
        @Override
        public int compare(DeviceItem device1, DeviceItem device2) {
            return device1.getDeviceId().compareTo(device2.getDeviceId());
        }
    };
    
    // Comparator Device Item By Device Id (ASC)
    public static Comparator<DeviceItem> ComparatorDeviceByFavorite = new Comparator<DeviceItem>() {
        @Override
        public int compare(DeviceItem device1, DeviceItem device2) {
            return device1.getFavorite().compareTo(device2.getFavorite());
        }
    };
}
